package utils;

import javax.servlet.http.HttpServletRequest;

public class Redis {

    public static String getRedisKey(HttpServletRequest req){
        //获取到客户端的ip地址
        String ip = req.getRemoteAddr();
        //获取到客户端不同浏览器的标识
        String header = req.getHeader("User-Agent").replaceAll("\\s*","");
        //拼接成用户登录的标识
        String s = ip + header;
        return s;
    }
}
